Repository navigation
hpc::abakus::pm: add_pm / neg_pm / sub_pm as an experimental library module - #433
Merged
Merged
Conversation
…module The P x M arithmetic moves out of the add_pm example into ndarray::hpc::abakus::pm, the one source of truth; Codec9 keeps the representation. add_pm and sub_pm return a #[must_use] PmSum: lane() reports a carry lane as Escaped, exact() is Some only when nothing carried, and the saturated bytes come only from into_saturated_parts(). The example keeps the scalar oracle and timing and calls the library, so tests/add_pm.rs (and the backend rows that run it) now test the library code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AdaWorldAPI
marked this pull request as ready for review
November 15, 2026 12:58
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
AdaWorldAPI
pushed a commit
that referenced
this pull request
Nov 15, 2026
Pm derived PartialEq, which needs U8x64: PartialEq; the nightly-simd realization's U8x64 does not implement it, so master's nightly row has been red since #433. Pm now compares pos and mag.to_array(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAqKMNZqKXSaeb9g2ypywF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This moves the Codec9
P × Marithmetic out of theadd_pmexample into a library module, so there is one copy of the code. It was approved after P2 (#432).Layout
ndarray::hpc::codec9(unchanged): the representation, meaning encode/decode, scale, rounding and the never-touched sentinel.ndarray::hpc::abakus::pm: the operations on values in that form, and their carry contract. It containsPm,touched,add_pm,neg_pmandsub_pm. The module is documented as experimental, with no stability guarantee.How carry lanes are exposed
All 512 codewords are valid values, so a carry lane can't be marked invalid inside the byte itself. Instead,
add_pmandsub_pmreturn a#[must_use]PmSum:lane(i)NeverTouched,Exact(i16), orEscapedfor a carry laneexact()Some(Pm)only when no lane carriedcarry()into_saturated_parts()There is no other way to get the lanes out as a plain
Pm.The example, tests and CI
examples/add_pm/pm.rsnow keeps only the scalar oracle and timing code. Thin wrappers call the library and returninto_saturated_parts().tests/add_pm.rs(11 tests, unchanged) now tests the library code. The same holds for the backend rows from add_pm probe: sub_pm as addition of the polarity-negated operand (P2) #432 that run it: avx2, avx, v2 and neon.PmSum::lane/exact/into_saturated_parts.Verification
tests/add_pm.rspasses 11/11 on AVX-512, and on avx2 / avx-qemu / v2-qemu / neon-qemu throughscripts/add-pm-backends.sh. The library unit tests pass 2/2.neg_pm(polarity flipped on zero magnitudes). 4 tests failed, which shows the suite exercises the library code.cargo clippy --features std --lib --test add_pm --example add_pm -D warningsis clean.cargo docshows no warnings from the new module; the crate's existing unresolved-link errors are unrelated. The facet-stride guard passes on the diff.Next
After this merges, the lab copy of the arithmetic in lance-graph's
xlog-relcomp-probe(PmLedger) gets replaced with a dependency on this module. That PR keeps itsi64oracle and end-to-end tests, and also records #2086's merge without a final-head review as a governance exception.Generated by Claude Code